var express = require('express');
var router = express.Router();
var { appModel }=require('../model/model')
/* GET home page. */
// router.get('/', function(req, res, next) {
//   res.render('index', { title: 'Express' });
// });
router.get('/getApp',async(req,res)=>{
  const data=await appModel.find()
  res.send({
    code:200,
    msg:'获取成功',
    data
  })
})
router.post('/add',async(req,res)=>{
  await appModel.create(req.body)
  res.send({
    code:200,
    msg:'添加成功'
  })
})
module.exports = router;
